package engine.game.physicalObjects.concreteObjects;

import engine.game.enums.BlobbyAction;
import engine.game.physicalObjects.MobileObject;
import engine.game.physicalObjects.PhysicalObject;
import engine.game.physicalObjects.StillObject;

public class SnowBlobby extends MobileObject {
	/* *********************************************************
	 * Attributes
	 * ********************************************************* */
	private static int MaxMove;
	private BlobbyAction _currentAction;
	private BlobbyAction _nextAction;
	
	
	@Override
	protected int getMaxMove() {
		return MaxMove;
	}

	@Override
	public void handleIntersectionWith(PhysicalObject phy) {
		if (phy instanceof MobileObject) {
			MobileObject mobileThing = (MobileObject)phy;
			handleIntersectionWithMobile(mobileThing);
		}else if (phy instanceof StillObject) {
			StillObject stillThing = (StillObject)phy;
			handleIntersectionWithStill(stillThing);
		}else{
			//handle intersection with something unusual ...
			//do nothing
		}
	}

	private void handleIntersectionWithStill(StillObject stillThing) {
		//TODO or not to do...
	}

	private void handleIntersectionWithMobile(MobileObject mobileThing) {
		if (mobileThing instanceof SnowBlobby) {
			SnowBlobby Blobby = (SnowBlobby)mobileThing;
			handleIntersectionWithSnowBlobby(Blobby);
		}else{} //TODO all the other relevant mobileObject
	}

	private void handleIntersectionWithSnowBlobby(SnowBlobby blobby) {
		//Nothing to do here for now ...
	}

	public void refreshAction() {
		if(this._nextAction != null){
			this._currentAction = this._nextAction;
			this._nextAction = null;
		}
	}
	
	public void setNextAction(BlobbyAction action){
		this._nextAction = action;
	}

	public void makeMove() {
		//TODO
	}
	
	public void initializePosition(int xPosition, int yPosition){
		this.setPosition(xPosition, yPosition);
	}
	

}
